# 应用于多组测试数据
# 小点：差分数组的前缀和就是原数组
while True:
    try:
        n,m=map(int,input().split())
        a=list(map(int,input().split()))
        diff=[0]*(n+1)
        diff[0]=a[0]
        # 差分数组
        for i in range(1,n):
            diff[i]=a[i]-a[i-1]

        for _ in range(m):
            x,y,z=map(int,input().split())
            x-=1
            y-=1
            # 性质
            diff[x]+=z
            diff[y+1]-=z
        # 将差分数组还原成原数组
        a[0]=diff[0]
        for i in range(1,n):
            a[i]=diff[i]+a[i-1]
        # 输出
        print(' '.join(map(str,a)))
    except:
        break